This invention relates to software executed on computer systems for displaying and storing image representations of documents.
Computer systems are often used to display an image representation of a scanned document such as a scanned page from a book, magazine and so forth. Such documents can contain text, colorized text and graphical or image content. Such documents are also stored as files on a storage media of the computer system. One problem associated with storing such files is that the size of the file is often large because of the color and image information.
Another problem encountered with displaying images of documents is the so-called xe2x80x9ccreasexe2x80x9d problem. When a book is scanned the spine portion of the book will often produce shadows. Shadowing produces a crease or visually displeasing portion when the image is displayed. The presence of the crease is also undesirable for compression of the document since it can be confused with text or graphics and will in any event increase the size of the compressed file corresponding to the document.
Also specialized computer systems, so-called reading machines, have been used to improve the educational attainment of individuals with learning disabilities. These reading machines which are typically general purpose or PC-based computers include specialized software that enable the reading machine to read selected text aloud to a user of the machine. Such specialized software processes and inputs source documents and generates synthetic speech to enable the user to read through the document a word, line, sentence, etc. at a time. These reading machines include a scanner to provide one technique to input source documents to the user.
One aspect of the invention is a computer program product for compressing data files representative of an image document. The document includes color information and/or graphical information. The product is on a computer readable medium and includes instructions for causing a computer to provide a first image file at a first resolution and a second image file at a second resolution of said document with said second resolution being lower than said first resolution. The product causes a computer to process the first image file to convert the first image file into a text file representation of the document and compress the text file representation of the document to provide a first compressed file. The computer processes the second file to extract information corresponding to color information and graphics information. It compresses the second file using a second, different compression technique to provide a second compressed file corresponding to the image and the color information from the low resolution image file. The product causes a computer to store said first and second compressed files to provide a composite file corresponding to the compressed file of the document.
One or more advantages are provided by the compression algorithm that can compresses portions of the document separately. This approach takes advantage of the different requirements needed for compression of text and image containing documents. For the documents containing text, particularly when used with optical character recognition software, a high resolution scan and lossless or near lossless compression technique are necessary to provide a useful representation of the document. However, using a high resolution scan and lossless compression technique to operate on the image portions of a document would be highly wasteful in that the image portions of the document would substantially and unnecessarily (for many instances) increase the file size associated with the stored document. Therefore, by providing separate graphical processing of the document with OCR text processing of the document, it is possible to satisfactorily compress the image or graphical portions of the document in a manner which provides a compressed image file having a minimal size file for image portions of the document while providing a file which maintains a high resolution, near lossless compression of text portions of the document.
In another aspect of the invention, a computer program product operable to determine a dominant background color associated with an image representation of a document containing color and text information includes instructions for causing a computer to retrieve background color information associating a background color with each one of a plurality of samples of pixels representing the document and filter the background colors to provide a target number of colors to represent the background colors. The product causes the computer to apply a median cut analysis on the background color samples to filter said background samples into one of a plurality of boxes corresponding to said target number of colors, and sort boxes by volume and intensity the to determine the dominant background color as a color to represent the background of the document by the box having the highest intensity.